﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using DTO;

namespace BUS
{
    public class Email_KhuyenMai_BUS
    {
        Email_KhuyenMai_DAO emailDAO = new Email_KhuyenMai_DAO();
        // 1.lấy danh sách tất cả email
        public List<Email_KhuyenMai> LayDanhSach_Email()
        {
            try
            {
                return emailDAO.LayDanhSach_Email();
            }
            catch (System.Exception ex)
            {
                return null;
            }
        }

        //2.phương thức lấy thông tin email
        public Email_KhuyenMai LayThongTin_EMailKhuyenMai(Email_KhuyenMai email)
        {
            try
            {
                return emailDAO.LayThongTin_EMailKhuyenMai(email);

            }
            catch (System.Exception ex)
            {
                return null;
            }
        }

        // 3.phương thức thêm email
        public bool Them_Email(Email_KhuyenMai email)
        {
            try
            {
                return emailDAO.Them_Email(email);
            }
            catch (Exception ex)
            {
                throw ex;
                return false;
            }
        }

        // 4.phương thức xóa email
        public bool Xoa_Email(Email_KhuyenMai email)
        {
            try
            {
                return emailDAO.Xoa_Email(email);
            }
            catch (Exception ex)
            {
                return false;
            }
        }

        // 5.phương thức sửa email
        public bool Sua_Email(Email_KhuyenMai email)
        {
            try
            {
                return emailDAO.Sua_Email(email);
            }
            catch (Exception ex)
            {
                return false;
            }
        }
       
    }
}
